﻿/*
 * Microsoft .NET  2.0+ version of Sphinx searchd client (Sphinx API)
 * 
 * Copyright (c) 2009, Shaun Berryman
 * All rights reserved
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License. You should have
 * received a copy of the GPL license along with this program; if you
 * did not, you can find it at http://www.gnu.org/
 */

using System;

namespace SphinxSearchApi
{
    /// <summary>
    /// Sets ranking mode. Only available in SPH_MATCH_EXTENDED2 matching mode at 
    /// the time of this writing. Parameter must be a constant specifying one of the known modes. 
    /// 
    /// By default, Sphinx computes two factors which contribute to the final match 
    /// weight. The major part is query phrase proximity to document text. The minor 
    /// part is so-called BM25 statistical function, which varies from 0 to 1 depending 
    /// on the keyword frequency within document (more occurrences yield higher weight) 
    /// and within the whole index (more rare keywords yield higher weight). 
    /// 
    /// However, in some cases you'd want to compute weight differently - or maybe avoid 
    /// computing it at all for performance reasons because you're sorting the result set 
    /// by something else anyway. This can be accomplished by setting the appropriate ranking mode. 
    /// </summary>
    public enum RankEnum : int
    {
        /// <summary>
        /// Default ranking mode which uses and combines both phrase proximity and BM25 ranking.
        /// </summary>
        Proximity_BM25 = 0,

        /// <summary>
        /// Statistical ranking mode which uses BM25 ranking only (similar to most other full-text 
        /// engines). This mode is faster but may result in worse quality on queries which contain 
        /// more than 1 keyword.
        /// </summary>
        BM25 = 1,

        /// <summary>
        /// Disabled ranking mode. This mode is the fastest. It is essentially equivalent to 
        /// boolean searching. A weight of 1 is assigned to all matches.
        /// </summary>
        None = 2,

        /// <summary>
        /// Ranking by keyword occurrences count. This ranker computes the amount of per-field 
        /// keyword occurrences, then multiplies the amounts by field weights, then sums the 
        /// resulting values for the final result.
        /// </summary>
        Wordcount = 3,

        /// <summary>
        /// Added in version 0.9.9-rc1, returns raw phrase proximity value as a result.
        /// This mode is internally used to emulate SPH_MATCH_ALL queries.
        /// </summary>
        Proximity = 4,

        /// <summary>
        /// Added in version 0.9.9-rc1, returns rank as it was computed in SPH_MATCH_ANY mode 
        /// ealier, and is internally used to emulate SPH_MATCH_ANY queries.
        /// </summary>
        MatchAny = 5,
        
        /// <summary>
        /// Added in version 0.9.9-rc2, returns a 32-bit mask with N-th bit corresponding to N-th
        /// fulltext field, numbering from 0. The bit will only be set when the respective field
        /// has any keyword occurences satisfiying the query.
        /// </summary>
        FieldMask = 6,

        /// <summary>
        /// 
        /// </summary>
        SPH04 = 7,

        /// <summary>
        /// 
        /// </summary>
        Total = 8
    }
}
